﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace EstructurasDeDatos
{
    public class ListaNodos<T> : Collection<Nodo<T>>
    {
        #region Constructores
        public ListaNodos() : base() { }

        public ListaNodos(int tamañoInicial)
        {

            for (int i = 0; i < tamañoInicial; i++)
                base.Items.Add(default(Nodo<T>));
        }
        #endregion

        #region Metodos
      
        public Nodo<T> FindByValue(T value)
        {
            // search the list for the value
            foreach (Nodo<T> nodo in Items)
                if (nodo.Valor.Equals(value))
                    return nodo;

            // if we reached here, we didn't find a matching node
            return null;
        }
        #endregion
    }
}
